<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<script>
    function init(){
        let abuttons=document.querySelectorAll(".btn_a");
        [...abuttons].forEach((item) => {
            item.addEventListener("click",(event)=>{
            let url=item.href.substring(item.href.lastIndexOf("/")+1);
            console.log(url);
            switch(url){
                case "emp":
                    document.getElementById("insertPoint").innerHTML="普通员工界面";
                    break;
                case "manager":
                document.getElementById("insertPoint").innerHTML="管理员工界面";
                    break;
            }
            history.pushState({},"",url);
        },false);
        });
    }
    
    window.addEventListener("load",init,false);
</script>
<body>
    <ul style="list-style:none">
        <li style="float:left;width:200px;text-align:center"><a class="btn_a" href="#emp">员工</a></li>
        <li style="float:left;width:200px;text-align:center"><a class="btn_a" href="#manager">员工</a></li>
    </ul>
    <br>
    <hr>
    <div id="insertPoint"></div>
</body>
</html>